<template>
	<view class="index">
		<u-modal 
			v-model="showModal"
			:show-cancel-button="true"
			confirm-text="去登录"
			@confirm="toLogin"
			content="请先登录,才能操作"
		>
		</u-modal>
	</view>
</template>

<script>
	import {mapState,mapMutations} from 'vuex'
	export default {
		data() {
			return {
				
			};
		},
		methods: {
			toLogin(){
				this.$store.commit('setLoginTip',false)
				this.$Router.push({name: 'user.login'})
			}
		},
		computed: {
			...mapState(['loginTip']),
			showModal:{
				get(){
					return this.loginTip
				},
				set(value){
					this.$store.commit('setLoginTip',value)
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
